﻿package com.vfd.animation{
	/**
	        * Animation class. Based off of mc_tween2.as project.
	        * @author Jeremy Wischusen <cortex@visualflowdesigns.com>
	* This is now basically a convienience class that wraps the functionality 
	* of ClipAnimator into a class that can be attached via a library linkage. 
	        */
	import flash.display.Sprite;
	import com.vfd.animation.ClipAnimator;
	public class AnimatedClip extends Sprite {
		private var _animator:ClipAnimator;
		public function AnimatedClip() {
			this._animator = new ClipAnimator(this);
		}
		public function resetPosition():void {
			this._animator.resetPosition();
		}
		public function moveToPoint(x:Number, y:Number,duration:Number = 0, loop:Boolean = false):void {
			this._animator.moveToPoint(x,y,duration,loop);
		}
		public function fadeTo(val:Number =0, duration:Number = 0, loop:Boolean = false):void {
			this._animator.fadeTo(val,duration,loop);
		}
		public function sizeTo(w:Number, h:Number, duration:Number=0, loop:Boolean = false):void {
			this._animator.sizeTo(w,h,duration, loop);
		}
		public function widthTo(w:Number, duration:Number, loop:Boolean = false):void {
			this._animator.widthTo(w, duration, loop);
		}
		public function heightTo(h:Number, duration:Number, loop:Boolean = false):void {
			this._animator.heightTo(h,duration,loop);
		}
		public function spinTo(rot:Number= 0, duration:Number = 0, loop:Boolean = false):void {
			this._animator.spinTo(rot,duration, loop);
		}
		public function xTo(x:Number, duration:Number = 0, loop:Boolean = false):void {
			this._animator.xTo(x, duration, loop);
		}
		public function yTo(y:Number, duration:Number = 0, loop:Boolean = false):void {
			this._animator.yTo(y,duration, loop);
		}
		public function set easing(ease:Function):void {
			this._animator.easing = ease;
		}
		public function colorTo(color:Number, duration:Number):void {
			this._animator.colorTo(color, duration);
		}
		public function set currentColor(clr:Number) {
			this._animator.currentColor = clr;

		}
		public function startOrbit():void {
			this._animator.startOrbit();
		}
		public function stopOrbit():void {
			this._animator.stopOrbit();
		}
		public function get animator():ClipAnimator {
			return this._animator;
		}
	}
}